package com.hera.process.config.service.impl;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hera.base.util.FiltroDTO;
import com.hera.process.config.dao.ProcessDao;
import com.hera.process.config.dao.SwimlaneDao;
import com.hera.process.config.service.SwimlaneService;
import com.hera.process.workflow.domain.Swimlane;
import com.hera.process.workflow.domain.SwimlanePK;

@Service("swimlaneservice")
public class SwimlaneServiceImpl implements SwimlaneService {

	static final Logger logger = Logger.getLogger(SwimlaneServiceImpl.class);
	
	@Autowired
	private ProcessDao processDao;
	@Autowired
	private SwimlaneDao swimlanedao;
	
	@Override
	public Swimlane findById(SwimlanePK id) {
		
		return swimlanedao.findOne(id);
	}

	@Override
	public void update(Swimlane entity) {
		
		swimlanedao.save(entity);
	}

	@Override
	public void save(Swimlane entity) {
		
		swimlanedao.save(entity);
	}

	@Override
	public void delete(Swimlane entity) {

		
		
		swimlanedao.delete(entity);
	}

	@Override
	public List<Swimlane> findAll() {
		
		return swimlanedao.findAll();
	}

	@Override
	public List<Swimlane> findAll(FiltroDTO filtroDTO) {
		
		return swimlanedao.obtenerEntidadesPorFiltros(filtroDTO);
	}
	
	@Override
	public List<Swimlane> findSwimlaneByProcessId(Long idProcess) {
		
		return swimlanedao.findSwimlaneByProcessId(idProcess);
	}

}
